{extend name="base" /}
{block name="body"}
<div class="layui-body" >
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief" >
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/votingRecord/votingRecord')}">投票记录列表</a></li>
            <li class="layui-this"><a href="{:url('admin/votingRecord/votingStatistics')}">投票统计</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="{:url('admin/VotingRecord/votingStatistics')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">投票人</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="微信昵称/openid" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>

                <table class="layui-table">
                    <thead>
                    <tr>

                        <th>投票人昵称</th>
                        <th>投票人openid</th>
                        <th>投票IP</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="Statistics" item="vo"}
                    <tr>

                        <td>{$vo.nickName}</td>
                        <td>{$vo.openId}</td>
                        <td>{$vo.voteIp}</td>

                        {switch name="vo.status"}
                            {case value="0"}
                                <td>
                                    <a href="{:url('admin/VotingRecord/status',['openId'=>$vo['openId'],'status'=>1])}" class="layui-btn layui-btn-normal layui-btn-mini ajax-update" >
                                        封禁
                                    </a>
                                </td>
                            {/case}
                            {case value="1"}
                                <td>
                                    <a href="{:url('admin/VotingRecord/status',['openId'=>$vo['openId'],'status'=>0])}" class="layui-btn layui-btn-normal layui-btn-mini ajax-update" style="background: red">
                                        解禁
                                    </a>
                                </td>
                            {/case}
                        {/switch}

                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$vote_record->render()}
            </div>
        </div>
    </div>
    <div id="imgManager" style="margin: auto;width: 200px;height: 200px;display: none;position:fixed;top:25%;left:50%;">
         <img  id="ims" style="width: 200px;height: 200px;" src="xxx" onclick="goCancel(this)"/>
    </div>
</div>
    <script type="text/javascript">
        function doCancel(obj){
            $("#imgManager").css("display","block");
            $("#ims").attr({
                "src": obj.src
            })
        }
        function goCancel(){
            $("#imgManager").css("display","none");
        }
    </script>
{/block}